package per.zzzfwd.query;

public class BetweenPredicate implements Predicate, Renderable {

    private Expression expression;
    private Expression lowerBound;
    private Expression upperBound;

    public BetweenPredicate(Expression expression, Expression lowerBound, Expression upperBound) {
        this.expression = expression;
        this.lowerBound = lowerBound;
        this.upperBound = upperBound;
    }

    public Expression getExpression() {
        return expression;
    }

    public Expression getLowerBound() {
        return lowerBound;
    }

    public Expression getUpperBound() {
        return upperBound;
    }

    @Override
    public String render() {
        return ((Renderable) expression).render() +
            ":[" + ((Renderable) lowerBound).render() + " TO " + ((Renderable) upperBound).render() + "]";
    }
}
